package com.ruoyi.control.service.impl;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; //添加
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.control.mapper.JhjsThreeMapper;
import com.ruoyi.control.domain.JhjsThree;
import com.ruoyi.control.service.IJhjsThreeService;

/**
 * 10603机巷局扇Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-08
 */
@Service
public class JhjsThreeServiceImpl extends ServiceImpl<JhjsThreeMapper, JhjsThree> implements IJhjsThreeService //修改
{
    @Autowired
    private JhjsThreeMapper jhjsThreeMapper;

    /**
     * 查询10603机巷局扇
     * 
     * @param tagName 10603机巷局扇主键
     * @return 10603机巷局扇
     */
    @Override
    public JhjsThree selectJhjsThreeByTagName(String tagName)
    {
        return jhjsThreeMapper.selectJhjsThreeByTagName(tagName);
    }

    /**
     * 查询10603机巷局扇列表
     * 
     * @param jhjsThree 10603机巷局扇
     * @return 10603机巷局扇
     */
    @Override
    public List<JhjsThree> selectJhjsThreeList(JhjsThree jhjsThree)
    {
        return jhjsThreeMapper.selectJhjsThreeList(jhjsThree);
    }

    /**
     * 新增10603机巷局扇
     * 
     * @param jhjsThree 10603机巷局扇
     * @return 结果
     */
    @Override
    public int insertJhjsThree(JhjsThree jhjsThree)
    {
        return jhjsThreeMapper.insertJhjsThree(jhjsThree);
    }

    /**
     * 修改10603机巷局扇
     * 
     * @param jhjsThree 10603机巷局扇
     * @return 结果
     */
    @Override
    public int updateJhjsThree(JhjsThree jhjsThree)
    {
        jhjsThree.setUpdateTime(DateUtils.getNowDate());
        return jhjsThreeMapper.updateJhjsThree(jhjsThree);
    }

    /**
     * 批量删除10603机巷局扇
     * 
     * @param tagNames 需要删除的10603机巷局扇主键
     * @return 结果
     */
    @Override
    public int deleteJhjsThreeByTagNames(String[] tagNames)
    {
        return jhjsThreeMapper.deleteJhjsThreeByTagNames(tagNames);
    }

    /**
     * 删除10603机巷局扇信息
     * 
     * @param tagName 10603机巷局扇主键
     * @return 结果
     */
    @Override
    public int deleteJhjsThreeByTagName(String tagName)
    {
        return jhjsThreeMapper.deleteJhjsThreeByTagName(tagName);
    }

    /**
     * 查询前端显示数据
     * @return
     */
    @Override
    public List<JhjsThree> getList() {
        List<JhjsThree> jhjsThreeList = new ArrayList<>();
        List<String> fanData = Arrays.asList("JKMS","JXMS","YKMS","ZJDY","ZJYJDJDY","ZJEJDJDY","YTJWZ","ZJDJWD","FL","FS","BJDY","BJDJWD","BJYJDJDY","BJEJDJDY","JDJWZ");
        for (String fanDatum : fanData) {
            JhjsThree jhjsThree = jhjsThreeMapper.selectJhjsThreeByTagName(fanDatum);
            jhjsThreeList.add(jhjsThree);
        }
        return jhjsThreeList;
    }
}
